package com.chixing.controller;

import com.chixing.pojo.Customer;
import com.chixing.service.UserCenterService;
import com.chixing.util.ServerResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class UserCenterController {
    @Autowired
    private UserCenterService userCenterService;
    @GetMapping("/user_center/{custId}")
    public ModelAndView getById(@PathVariable("custId") Integer custId){
      ServerResponse serverResponse = userCenterService.getByTd(custId);
      ModelAndView mav = new ModelAndView();
      mav.addObject("serverResponse",serverResponse);
      mav.setViewName("customer/user_center");
      return mav;
    }

}
